﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class User_ReaderAccount : System.Web.UI.Page
{
    public string nowaccount, qiankuan;
    protected void Page_Load(object sender, EventArgs e)
    {
       
        if (Session["userName"] != null)
        {
            SQL sql = new SQL();
            nowaccount = sql.getDataFormTable("ACCOUNT", "reader_info", "readerid", Session["userName"].ToString(), "", "", "", "", 1);
            if (Convert.ToDouble(nowaccount) > 0)
                qiankuan = "0 元";
            else
                qiankuan = nowaccount+" 元";
            nowaccount += " 元";
        }
        else
        {
            Response.Write("<script language=javascript>alert('您还没有登陆');window.location = '../Common/BMindex.aspx';</script>");
        }
    }
    /*这个是用户点击查询欠费情况的记录*/
    protected void Sure_Click(object sender, EventArgs e)
    {
        SqlDataSource1.SelectCommand = "select Amerce.AmerceID as 罚款流水单号,Amerce.Amerce AS 罚款金额,BookName as 图书条目,ADate as 罚款时间,Areason as 原因 from Amerce,Amerce_info,Book_info where Amerce.AmerceType=Amerce_info.AmerceTypeID and AReader=@name and  (ADate between @date1 and @date2) and Book_info.BookID=Amerce.ABookID";


        SqlDataSource1.SelectParameters["name"].DefaultValue = Session["userName"].ToString();
        SqlDataSource1.SelectParameters["date1"].DefaultValue = date1.Value.ToString();
        SqlDataSource1.SelectParameters["date2"].DefaultValue = date2.Value.ToString();
                
    }
}